From 85f21322aebb793ee35bdb1ad16d00ac7d92fb49 Mon Sep 17 00:00:00 2001 From: Jonathan Dieter Date: Wed, 6 Jun 2018 13:23:04 +0300 Subject: [PATCH] Fix error where we don't check for hash_type < 0 Signed-off-by: Jonathan Dieter --- src/lib/hash/hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/hash/hash.c b/src/lib/hash/hash.c index 29f5560..de9277f 100644 --- a/src/lib/hash/hash.c +++ b/src/lib/hash/hash.c @@ -409,7 +409,7 @@ int PUBLIC zck_validate_data_checksum(zckCtx *zck) { } const char PUBLIC *zck_hash_name_from_type(int hash_type) { - if(hash_type > 1) { + if(hash_type > 1 || hash_type < 0) { snprintf(unknown+8, 21, "%i)", hash_type); return unknown; } -- 2.30.2